package
{
	import flash.display.Bitmap;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	
	public class Racer1 extends Sprite
	{
		private var car:Car;
		//缩略图
		private var thumbNail:Bitmap;
		public function Racer1()
		{
			stage.align = StageAlign.TOP_LEFT;
			stage.scaleMode = StageScaleMode.NO_SCALE;
			stage.addEventListener(Event.RESIZE,resize);
			
			
			var loader:ImgLoader = new ImgLoader("abc.swf");
			loader.addEventListener(Event.COMPLETE,loadThumbCompelete);
			loader.load();
			
		}
		private function loadThumbCompelete(event:Event):void{
			event.target.removeEventListener(Event.COMPLETE,loadThumbCompelete);
			
			var classObj:Class=event.target.loader.contentLoaderInfo.applicationDomain.getDefinition("CarMC") as Class;
			var content:MovieClip = new classObj();
			car = new Car(15,0.25,5,6,80,new CarKeyboard(stage),content);
			car.x = 100;
			car.y = 100;
			addChild(car);
			
		}
		private function resize(event:Event):void{
			//trace(stage.stageWidth);
			//trace(stage.stageHeight);
		}
	}
}